﻿#ifndef FILETREESERVICE_H
#define FILETREESERVICE_H


#include <util/listutil.h>

#include <QDebug>
#include <QQueue>

class FileModel;
class FileTree;
class FileUtil;

class FileTreeService
{
public:
    FileTreeService();

    // 初始化文件树
    FileModel* initTree(QString path){
        FileModel* root = getAll(path);
        return root;
    }
    // 获取当前目录下所有文件
    QList<FileModel*> getChildren(QString fullPath);

    // 递归目录下所有文件
    FileModel* getAll(QString fullPath);

    void getAllRecursion(QString fullPath, FileModel* root, int deep);

    QList<FileModel*> getList(FileModel* root);

    // 搜索
    FileModel* searchTree(FileModel* root, QString key);

    // 点击节点展开
    QList<FileModel*> openNode(FileModel* root,QString fullPath);

};

#endif // FILETREESERVICE_H
